package ca.skygazer.shared.coords;

import java.io.Serializable;

@SuppressWarnings("serial")
public class AzAltCoord implements Serializable {
	public double az=0;
	public double alt=0;
	
	public AzAltCoord(){
	}
	public AzAltCoord(double az, double alt){
		this.az=az;
		this.alt=alt;
	}
	public XYCoord getXYCoord(double r){
		double radius=(1-Math.abs(alt)/Math.PI*2)*r;
		double x=r-radius*Math.sin(az);
		double y=r-radius*Math.cos(az);
		return new XYCoord(x, y);
	}
	public AzAltCoord copy(){
		return new AzAltCoord(az,alt);
	}
	public AzAltCoord translate(AzAltCoord trans){
		this.az=this.az+trans.az;
		this.alt=this.alt+trans.alt;
		return this;
	}
}
